package com.lq.tech.web.index;

import com.lq.tech.infra.*;
import com.lq.tech.service.index.IndexFloorConfService;
import com.lq.tech.service.index.IndexFloorInfoService;
import com.lq.tech.service.index.IndexSlideshowService;
import com.lq.tech.service.vo.index.IndexSlideshowVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * 首页
 *
 * @author LiChangjaing
 * @email lichangjiang@liqingtech.com
 * @date 2018-11-02 11:46:49
 */
@RestController
@RequestMapping("/index")
public class IndexController extends BasicController
{
    @Autowired
    private IndexSlideshowService indexSlideshowService;

    @Autowired
    private IndexFloorConfService indexFloorConfService;
    @Autowired
    private IndexFloorInfoService indexFloorInfoService;

    /**
     * 查询轮播图
     */
    @RequestMapping(value = "/listSlideshow", method = RequestMethod.GET)
    @ApiOperation(value = "查询轮播图")
    public ActionResult listSlideshow()
    {
        return actionResult( indexSlideshowService.listSlideshow());
    }

    /**
     * 查询楼层
     */
    @RequestMapping(value = "/listFloorConfig", method = RequestMethod.GET)
    @ApiOperation(value = "查询楼层配置")
    public ActionResult listFloor()
    {
        return actionResult( indexFloorConfService.listFloor());
    }

    /**
     * 查询楼层数据
     */
    @RequestMapping(value = "/listFloorData", method = RequestMethod.GET)
    @ApiOperation(value = "查询楼层数据")
    public ActionResult listFloorData(String floorId)
    {
        return actionResult( indexFloorInfoService.listByFloor(floorId));
    }
}
